package com.treetao.union.db.service.impl;

import com.treetao.union.db.model.MallSkillSku;
import com.treetao.union.db.mapper.MallSkillSkuMapper;
import com.treetao.union.db.service.MallSkillSkuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Dev.M
 * @since 2020-05-21
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MallSkillSkuServiceImpl extends ServiceImpl<MallSkillSkuMapper, MallSkillSku>
		implements MallSkillSkuService {

	@Override
	public boolean existSkillSku(Long skillId, Long skuId) {
		QueryWrapper<MallSkillSku> q = new QueryWrapper<MallSkillSku>();
		q.eq("skillId", skillId);
		q.eq("skuId", skuId);
		return count(q) > 0;
	}

}
